home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / mayaHardwareSetCommonGlobalV < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.0 KB  |  124 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. global proc mayaHardwareSetCommonGlobalValue(
  18.     string $global,
  19.     string $value)
  20. {
  21.     //
  22.     // Description:
  23.     //    This procedure is called when the current renderer has changed from
  24.     //    some other renderer to the Maya Hardware renderer. It is called in the
  25.     //    process of copying common global values from the previous renderer to
  26.     //    the Maya Hardware renderer.
  27.     //    This procedure sets the value of the global specified by $global to the
  28.     //    value specified by $value.
  29.     //    For a complete list of valid values for the $global argument, and to
  30.     //    see how this procedure is used, see copyCommonRenderGlobals.mel.
  31.     //
  32.  
  33.     int $intValue;
  34.     float $floatValue;
  35.     
  36.     switch ($global)
  37.     {
  38.         case "animation":
  39.             $intValue = $value;
  40.             setAttr defaultRenderGlobals.animation $intValue;
  41.             break;
  42.         case "startFrame":
  43.             $floatValue = $value;
  44.             setAttr hardwareRenderGlobals.startFrame $floatValue;
  45.             break;
  46.         case "endFrame":
  47.             $floatValue = $value;
  48.             setAttr hardwareRenderGlobals.endFrame $floatValue;
  49.             break;
  50.         case "byFrame":
  51.             $floatValue = $value;
  52.             setAttr hardwareRenderGlobals.byFrame $floatValue;
  53.             break;
  54. // These globals are not yet supported by the Maya Hardware Renderer
  55. //
  56. //        case "framePadding":
  57. //            break;
  58.         case "renderableObjects":
  59.             global string $hardwareRenderSelectedFlag;
  60.             if ($value == "selected")
  61.             {
  62.                 $hardwareRenderSelectedFlag = "-renderSelected";
  63.             }
  64.             else if ($value == "all")
  65.             {
  66.                 $hardwareRenderSelectedFlag = "";
  67.             }
  68.             break;
  69.         case "useCustomExtension":
  70.             $intValue = $value;
  71.             setAttr hardwareRenderGlobals.useCustomExtension $intValue;
  72.             break;
  73.         case "customExtension":
  74.             setAttr -type "string" hardwareRenderGlobals.customExtension $value;
  75.             break;
  76.         case "renumberFramesUsing":
  77.             $intValue = $value;
  78.             setAttr hardwareRenderGlobals.modifyExtension $intValue;
  79.             break;
  80.         case "renumberStartFrame":
  81.             $floatValue = $value;
  82.             setAttr hardwareRenderGlobals.startExtension $floatValue;
  83.             break;
  84.         case "renumberByFrame":
  85.             $floatValue = $value;
  86.             setAttr hardwareRenderGlobals.byExtension $floatValue;
  87.             break;
  88. // These globals are not yet supported by the Maya Hardware Renderer
  89. //
  90. //        case "maintainWidthHeightRatio":
  91. //            break;
  92.         case "width":
  93.             $intValue = $value;
  94.             setAttr hardwareRenderGlobals.resolutionX $intValue;
  95.             break;
  96.         case "height":
  97.             $intValue = $value;
  98.             setAttr hardwareRenderGlobals.resolutionY $intValue;
  99.             break;
  100.         case "deviceAspectRatio":
  101.         // We do not copy the device ratio. Only Pixel ratio is stored.
  102.             break;
  103.         case "pixelAspectRatio":
  104.             $floatValue = $value;
  105.             setAttr hardwareRenderGlobals.pixelAspectRatio $floatValue;
  106.             break;
  107.         case "enableDefaultLight":
  108.             $intValue = $value;
  109.             setAttr hardwareRenderGlobals.enableDefaultLight $intValue;
  110. // These globals are not yet supported by the Maya Hardware Renderer
  111. //
  112. //        case "pluginFormat":
  113. //            break;
  114.         case "preRenderMel":
  115.             if(!`about -evalVersion`)
  116.                 setAttr -type "string" hardwareRenderGlobals.preRenderMel $value;
  117.             break;
  118.         case "postRenderMel":
  119.             if(!`about -evalVersion`)
  120.                 setAttr -type "string" hardwareRenderGlobals.postRenderMel $value;
  121.             break;
  122.     }
  123. }
  124.